package com.liuyi.netty.im.test.im.listeners;

import io.netty.channel.Channel;

/**
 * 抽象的监听器
 *
 * @author Mr.Fmy
 * @since 2022/1/19
 */
public abstract class ImAbstractListener<T> implements ImListener {

    @Override
    public void handler(Channel channel, Object data) {
        handler0(channel, data != null ? convert(data) : null);
    }

    public abstract void handler0(Channel channel, T data);

    public abstract T convert(Object data);
}
